class BlackMedium:
    feture="Ugly"

    def __init__(self,name,addr):
        self.name=name
        self.addr=addr

    def sell_hourse(self):
        print('正在卖房子,傻逼才买呢',self.name)
    def rent_hourse(self):
        print('正在租房子,傻逼才租呢',self.name)
    

b1=BlackMedium('万城置地','天露园')

#hasattr  判断object中有没有一个 name字符串对应的方法或属性
print(hasattr(b1,'sell_hourse'))
print(hasattr(b1,'name'))

print(getattr(b1,'name'))
func=getattr(b1,'sell_hourse')
func()


setattr(b1,'sb',True)